import javax.swing.*;
public class Piece extends JButton
{
  
  static final long serialVersionUID = 0;
  
  int x;
  int y;
  boolean isKing;
  
  public Piece()
  {
    
    isKing = false;
    
    //Set Button Properties
    setLayout(null);
    setSize(50,50);
    setOpaque(false);
  }
  
  public void setPosition(int i, int j)
  {
    
    x = i;
    y = j;
    
    //Set Button's Location in Window
    setLocation(x * 50, y * 50);
  }
  
  public boolean isOnBoard()
  {
    return (0 <= x && x < 8 && 0 <= y && y < 8);
  }
}
